package com.jrx.anytxn.transaction.timer.job.payment.step;

import com.jrx.anytxn.transaction.entity.TlPaymentLog;
import com.jrx.anytxn.transaction.service.IPaymentLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 还款 - processor
 *
 * @author jing.xy
 */
@Service
public class PaymentProcessor implements ItemProcessor<TlPaymentLog, TlPaymentLog> {

    Logger logger = LoggerFactory.getLogger(PaymentProcessor.class);

    @Autowired
    private IPaymentLogService paymentLogService;

    @Override
    public TlPaymentLog process(TlPaymentLog log) throws Exception {
        TlPaymentLog updateLog =  paymentLogService.pay(log);
        return updateLog;
    }

}
